# coding:utf-8

fruits = {
    'apple': 30,
    'banana': 50,
    'pear': 100
}

real_fruits = fruits.copy()  # copy() 返回原字典的浅拷贝
print(real_fruits)  # {'apple': 30, 'banana': 50, 'pear': 100}

real_fruits['orange'] = 50
real_fruits.update({'cherry': 100})  # update([other]) 使用来自 other 的键/值对更新字典，覆盖原有的键。 返回 None。

print(real_fruits)  # {'apple': 30, 'banana': 50, 'pear': 100, 'orange': 50, 'cherry': 100}
print(fruits)  # {'apple': 30, 'banana': 50, 'pear': 100}

real_fruits['apple'] = real_fruits['apple'] - 5
print(real_fruits)
real_fruits['pear'] -= 3
print(real_fruits)

real_fruits.clear()
print(real_fruits)
print('第二天...')
real_fruits = fruits.copy()
print(real_fruits)
